import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Manage',
    component: () => import(/* webpackChunkName: "about" */ '../views/Manage.vue'),
    redirect: "/home",
    children:[
      {path: 'home',
        name: '主页',
        component: () => import(/* webpackChunkName: "about" */ '../views/Home.vue')
      },
      {path: 'kehu',
        name: '客户管理',
        component: () => import(/* webpackChunkName: "about" */ '../views/Kehu.vue')
      },
      {path: 'person',
        name: '个人信息',
        component: () => import(/* webpackChunkName: "about" */ '../views/Person.vue')
      },
      {path: 'file',
        name: '文件',
        component: () => import(/* webpackChunkName: "about" */ '../views/File.vue')
      },
      {path: 'fix',
        name: '在线报修',
        component: () => import(/* webpackChunkName: "about" */ '../views/Fix.vue')
      },
      {path: 'carport',
        name: '车位信息',
        component: () => import(/* webpackChunkName: "about" */ '../views/Carport.vue')
      },
      {path: 'service',
        name: '周边服务',
        component: () => import(/* webpackChunkName: "about" */ '../views/Service.vue')
      },
      {path: 'complaint',
        name: '投诉建议',
        component: () => import(/* webpackChunkName: "about" */ '../views/Complaint.vue')
      },
      {path: 'helpold',
        name: '爱心关怀',
        component: () => import(/* webpackChunkName: "about" */ '../views/Helpold.vue')
      },
      {path: 'role',
        name: '角色管理',
        component: () => import(/* webpackChunkName: "about" */ '../views/Role.vue')
      },
      {path: 'menu',
        name: '菜单管理',
        component: () => import(/* webpackChunkName: "about" */ '../views/Menu.vue')
      },
      {path: 'forum',
        name: '社区论坛',
        component: () => import(/* webpackChunkName: "about" */ '../views/Forum.vue')
      }
    ]
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },
  {path: '/login',
    name: '登录',
    component: () => import(/* webpackChunkName: "about" */ '../views/Login.vue')
  },
  {path: '/register',
    name: '注册',
    component: () => import(/* webpackChunkName: "about" */ '../views/Register.vue')
  },
  {path: '/front',
    name: '前台',
    component: () => import(/* webpackChunkName: "about" */ '../views/front/Front.vue'),
    children:[
      {path: 'home',
        name: '前台',
        component: () => import(/* webpackChunkName: "about" */ '../views/front/Home.vue')
      },
      {path: 'person',
        name: '个人信息',
        component: () => import(/* webpackChunkName: "about" */ '../views/front/Person.vue')
      },
      {path: 'fix',
        name: '故障报修',
        component: () => import(/* webpackChunkName: "about" */ '../views/front/Fix.vue')
      },
      {path: 'complaint',
        name: '意见反馈',
        component: () => import(/* webpackChunkName: "about" */ '../views/front/Complaint.vue')
      },
      {path: 'helpold',
        name: '爱心关怀',
        component: () => import(/* webpackChunkName: "about" */ '../views/front/Helpold.vue')
      },
      {path: 'map',
        name: '地图',
        component: () => import(/* webpackChunkName: "about" */ '../views/front/Map.vue')
      },
      {path: 'forum',
        name: '社区论坛',
        component: () => import(/* webpackChunkName: "about" */ '../views/front/Forum.vue')
      },
      {path: 'forumDetail',
        name: '社区论坛',
        component: () => import(/* webpackChunkName: "about" */ '../views/front/ForumDetail.vue')
      },
      {path: 'carport',
        name: '社区车位',
        component: () => import(/* webpackChunkName: "about" */ '../views/front/Carport.vue')
      },
      {path: 'service',
        name: '同城服务',
        component: () => import(/* webpackChunkName: "about" */ '../views/front/Service.vue')
      }



    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
